package com.edu.service;

import com.edu.bean.Feedback;
import com.edu.dao.FeedbackDao;
import java.util.List;

public class AdminFeedbackService {
    private FeedbackDao feedbackDao = new FeedbackDao();

    /**
     * 分页获取反馈列表
     */
    public List<Feedback> getFeedbackByPage(String title, int currentPage, int pageSize) {
        int start = (currentPage - 1) * pageSize;
        return feedbackDao.findByPage(title, start, pageSize);
    }

    /**
     * 获取反馈总数
     */
    public int getFeedbackCount(String title) {
        return feedbackDao.findTotalCount(title);
    }

    /**
     * 根据ID获取反馈详情
     */
    public Feedback getFeedbackById(Integer feedbackId) {
        return feedbackDao.findById(feedbackId);
    }
}